From 63c110cdebc2c692964e1250c6f74f9e8c47c85d Mon Sep 17 00:00:00 2001
From: Myy <myy@miouyouyou.fr>
Date: Tue, 10 Jan 2017 04:28:48 +0000
Subject: [PATCH 4/5] Adapt get_user_pages calls to use the new calling
 procedure

These changes are due to this commit:
mm: replace get_user_pages_remote() write/force parameters with gup_flags
9beae1ea89305a9667ceaab6d0bf46a045ad71e7
Kernel: 4.9.0-rc

Signed-off-by: Myy <myy@miouyouyou.fr>
---
 drivers/base/ump/src/linux/ump_kernel_linux_mem.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/base/ump/src/linux/ump_kernel_linux_mem.c b/drivers/base/ump/src/linux/ump_kernel_linux_mem.c
index 9186dd0..def4c0e 100644
--- a/drivers/base/ump/src/linux/ump_kernel_linux_mem.c
+++ b/drivers/base/ump/src/linux/ump_kernel_linux_mem.c
@@ -35,6 +35,10 @@
 #include <ump_arch.h>
 #include <common/ump_kernel_priv.h>
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
+#include <linux/pfn_t.h>
+#endif
+
 static void umpp_vm_close(struct vm_area_struct *vma)
 {
 	umpp_cpu_mapping * mapping;
@@ -222,7 +226,11 @@ int umpp_linux_mmap(struct file * filp, struct vm_area_struct * vma)
 				paddr = alloc->block_array[block_idx].addr;
 			}
 
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(4,4,0))
 			err = vm_insert_mixed(vma, vma->vm_start + (i << PAGE_SHIFT), paddr >> PAGE_SHIFT);
+#else
+			err = vm_insert_mixed(vma, vma->vm_start + (i << PAGE_SHIFT), __pfn_to_pfn_t(paddr >> PAGE_SHIFT, PFN_DEV));
+#endif
 			paddr += PAGE_SIZE;
 		}
 
-- 
2.10.2

